package com.ss.android.newmedia.a;

import android.support.v4.view.ViewPager;

public class OnPageScrolledListener extends ViewPager.SimpleOnPageChangeListener {
    private long a;
    protected long b;
    private boolean c;

    public OnPageScrolledListener() {
        this.a = 0;
        this.b = 0;
        this.c = false;
    }

    public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
        if(position != 0 || positionOffsetPixels > 0) {
            this.c = false;
        }
        else {
            long v0 = System.currentTimeMillis();
            if(v0 - this.b > 800) {
                this.c = false;
            }

            this.b = v0;
            if(this.c) {
                if(v0 - this.a <= 2000) {
                    return;
                }

                this.a = v0;
                return;
            }

            this.c = true;
        }
    }
}

